<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>后盾人</title>
  </head>
  <body></body>
  <script>
    function User(name, age) {
      this.name = name;
      this.age = age;
    }
    User.prototype.show = function() {
      console.log(this.name, this.age);
    };
    let obj = {};
    console.log(obj.__proto__ == Object.prototype);
    function admin(name, age) {
      const instance = Object.create(User.prototype);
      User.call(instance, name, age);
      instance.role = function() {
        console.log("role");
      };
      return instance;
    }
    let hd = admin("向军", 19);
    hd.show();
    hd.role();
    function member(name, age) {
      const instance = Object.create(User.prototype);
      User.call(instance, name, age);
      return instance;
    }

    let lisi = member("李四", 23);
    lisi.show();
  </script>
</html>
